package com.zsj.service_user.util;

import javax.validation.constraints.NotNull;
import java.math.BigInteger;
import java.security.MessageDigest;

public class TokenMd5 {
    public static String getMD5(String str) {
        if (str.equals("")){
            return null;
        }
        if (str.isEmpty()){
            return null;
        }
        try {
            MessageDigest md = MessageDigest.getInstance("MD5");
            md.update(str.getBytes());
            return new BigInteger(1, md.digest()).toString(16);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

}
